package demo2;

class OuterClass{
    public int a = 100;
    static int b = 100;
    public void methodA(){}

    public static void methodB(){}

    //被static修饰的内部类，静态内部类
    public static class InnerClass{
        public void methodInner(){
            OuterClass outerclass = new OuterClass();
            outerclass.a = 10;//编译失败，因为a不是静态外部类成员变量
            b = 20;
            outerclass.methodA();//编译失败，因为该方法不是静态外部类成员方法
            methodB();
        }
    }
}
public class test2 {
    public static void main(String[] args) {
        //静态内部类对象创建和访问
        OuterClass. InnerClass t2 = new OuterClass.InnerClass();
        t2.methodInner();
    }
}
